package com.tl.juc.c3;

public class C1_VisibilityTest {
    static volatile Boolean always = true;

    public static void main(String[] args) throws InterruptedException {
        // 线程1
        new Thread(() -> {
            while (always) {

            }
        }).start();

        Thread.sleep(1000);

        // 线程2
        always = false;
    }
}
